<!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<tpl> $NCharset </tpl>" />
<tpl>include file ='../head.config.html'</tpl>
<link href="<tpl> $template_dir </tpl>/home/css/search.css" rel="stylesheet" type="text/css" />
</head>
<body><tpl>include file ='../header.html'</tpl> 
<div id="wrapper" class="m">
  <!-- Header -->
  <!-- End Header -->
  <div class="clear">&nbsp;</div>
  <!-- 位置导航 -->
  <div id="sitenav"><span><a href="<tpl> $site_url </tpl>"><tpl> $langCIndex </tpl></a> > <tpl> $langCSearchShop </tpl></span></div>
  <!-- End位置导航 -->
  <div id="searchbox">
    <div id="searchpicshop"></div>
    <ul id="searchtab">
      <li><a href="product.php?action=search"><span><tpl> $langCSearchBaby </tpl></span></a></li>
      <li class="current"><a href="JavaScript: void(null);"><span><tpl> $langCSearchShop </tpl></span></a></li>
    </ul>
    <div class="searchcontent">
      <form id="mainform" action="shop.php" method="get">
        <ul class="form_advance" id="searchitem">
          <li>
            <div class="searchformleft"><tpl> $langShopName </tpl>：</div>
            <div class="searchformright">
              <INPUT class="searchforminput" id="keyword" accessKey="s" size="48" name="keyword">
            </div>
          </li>
          <li>
            <div class="searchformleft"><tpl> $langShopShopkeeperName </tpl>：</div>
            <div class="searchformright">
              <INPUT class="searchforminput" id="seler_name" size="48" name="txtMaster">
            </div>
          </li>
          <li>
            <div class="searchformleft"><tpl> $langShopSaleRange </tpl>：</div>
            <div class="searchformright">
              <INPUT class="searchforminput" name="txtSaleRange">
            </div>
          </li>
          <li>
            <div class="searchformleft"><tpl> $langShopArea </tpl>：</div>
            <div class="searchformright">
				<input type="hidden" name="shop_area_id" id="shop_area_id" />
            	<select id="c1" class="searchformselect" name="c1" style="width: 120px">
					<option valus="" selected></option>
					<tpl> foreach item = parent from = $area_array </tpl>
					<option value="<tpl>$parent.area_id</tpl>||<tpl>$parent.is_parent</tpl>"><tpl> $parent.area_name </tpl></option>
					<tpl> /foreach </tpl>
				</select>
				<select class="searchformselect" id="c2" style="width: 120px" name="c2">
				</select>
				<select class="searchformselect" id="c3" style="width: 120px" name="c3">
				</select>
				<select class="searchformselect" id="c4" style="width: 120px" name="c4">
				</select>
            </div>
          </li>
          <li>
            <div class="searchformleft"><tpl> $langShopSort </tpl>：</div>
            <div class="searchformright">
              <tpl> $shop_select_category </tpl>
            </div>
          </li>
          <li class="submitbox" >
            <input type="image" name="imageField" id="imageField" src="<tpl> $site_url </tpl>/templates/green/home/images/searchbtn_shop.gif" />
          </li>
        </ul>
      </form>
    </div>
  </div>
</div>
  <tpl> include file ='../../../html/footer.html' </tpl>
</body>
</html>
<script language="javascript">
//地区选择
function tonext(whos) {
	$(whos).change(
		function(){
			var valarray=$(this).val().split('||');	
			$('#shop_area_id').val(valarray[0]);
			if (valarray[1]=='1') {
				$(this).next().attr('disabled','true').html('<option value="" selected="selected"><tpl> $langCDataToLoading </tpl></option>');
				$.get(
					'../home/tohtml.php',
					{action:'get_area',id:valarray[0],random_number:Math.random()},
					function(data){
						DataArray = data.split("|||");
						var a='';
						for (var i = 0; i<DataArray.length-1; i++) {
							att=DataArray[i].split("||");
							id=att[0];
							cla=att[2];
							a+='<option value="'+id+'||'+cla+'">'+att[1]+((cla=='1')?' ->':'')+'</option>';
						}
						
					$(whos).next().removeAttr('disabled').html('<option value="" selected="selected"></option>'+a).nextAll().html('');
					tonext($(whos).next());
					}
				)
			} else {
				$(whos).nextAll().html('').attr('disabled','true');
			};
		}
	)
};
$(document).ready(function(){
//地区选择
tonext('#c1');
})
</script>